{extend name="public/common"}

{block name="style"}
<title>点对点教育VIP学员_个人中心</title>
<link rel="stylesheet" href="__HOME__/css/user/user.css">
<style>
	.phone{
		width: 18vw;
		text-align: center;
		position:absolute;
		top: 2.67vw;
		left:2.67vw;
	}
	.phone>img{
		width:6.35vw;
		height:6.35vw;
		display:block;
		margin: 0 auto;
	}
	.phone>span{
		font-size: 1.36rem;
		color:#fff;
	}
	.rule>img{
		width:6.35vw;
		height:6.35vw;
	}
</style>
{/block}

{block name="body"}
<div class="banner">
	<div class="up" data-tab="{$user.headimgurl}"></div>
	<div class="name">{$user.name}</div>
	{if condition="$user.subscribe eq 1 and $user.review_status eq 1"}
	<div class="phone">
		<img src="__HOME__/images/user/call.png" alt="">
		<span>联系方式</span>
	</div>
	{/if}
	{if condition="$user.subscribe eq 1 and $user.role eq 0"}
	<div class="rule">
		<img src="__HOME__/images/user/ranks.png" alt="">
		<span>积分规则</span>
	</div>
	{/if}
</div>
<div class="content_nav clearfix">
	<div>
		<div class="fl">
			<p>我的积分</p>
			<p><span>{$user.score}</span></p>
			<span class="line"></span>
		</div>
		<div class="fl">
			<p>我的排行</p>
			<p>{$user.rankk}</p>
		</div>
	</div>
</div>

<div class="lists">
	<a href="{:Url('User/personal')}" class="list clear">
		<span>基本资料</span>
		<i class="fa fa-angle-right fr"></i>
	</a>
	{eq name="$user.subscribe" value="1"}
	<a href="{:Url('User/register')}" class="list clear">
		<span>信息认证</span>
		<i class="fa fa-angle-right fr"></i>
	</a>
	{/eq}
	{if condition="$user.review_status eq 1 and $user.role eq 0"}
	<a href="{:Url('User/sign')}" class="list clear">
		<span>我的签到</span>
		<i class="fa fa-angle-right fr"></i>
	</a>
	<a href="{:Url('Journal/personal')}" class="list clear">
		<span>我的总结</span>
		<i class="fa fa-angle-right fr"></i>
	</a>
	<a href="{:Url('Test/testlist')}" class="list clear">
		<span>我的测试</span>
		<i class="fa fa-angle-right fr"></i>
	</a>
	<a href="{:Url('Sign/index')}" class="list clear">
		<span>我的课表</span>
		<i class="fa fa-angle-right fr"></i>
	</a>
	<a href="{:Url('School/index')}" class="list clear">
		<span>入学指导</span>
		<i class="fa fa-angle-right fr"></i>
	</a>
	{eq name="$user.openid" value="oJuxj0_Ju_RIb2HbwYxXwAdYLch0"}
	<a href="{:Url('Paper/index')}" class="list clear">
		<span>每日统计</span>
		<i class="fa fa-angle-right fr"></i>
	</a>
	{/eq}
	{/if}
	{if condition="$user.review_status eq 1 and $user.role eq 1"}
	<a href="{:Url('User/see')}" class="list clear">
		<span>学员管理</span>
		<i class="fa fa-angle-right fr"></i>
	</a>
	<a href="{:Url('Scan/test')}" class="list clear">
		<span>测试统计</span>
		<i class="fa fa-angle-right fr"></i>
	</a>
	<a href="{:Url('Write/index')}" class="list clear">
		<span>入学指导</span>
		<i class="fa fa-angle-right fr"></i>
	</a>
	<a href="{:Url('Paper/index')}" class="list clear">
		<span>每日统计</span>
		<i class="fa fa-angle-right fr"></i>
	</a>
	{/if}
</div>
<div id="bk" style="">
	<div>
		<a></a>
		<p>
			您可以通过以下内容获取相应积分，具体如下：
			<br>
			<br>
			每日成功签到：<b>+0.5</b>分
			<br>
			每日提交学习总结：<b>+1</b>分
			<br>
			每次测试成绩提交：<b>+1</b>分
			<br>
			上课扫码签到（正常）：<b>+1</b>分
			<br>
			上课扫码签到（迟到）：<b>-1</b>分
			<br>
			上课扫码签到（旷课）：<b>-3</b>分
			<br>
			通过以上互动行为，您可以累积积分，并在积分排行榜中显示个人积分排行状况！加油哦！
		</p>
	</div>
</div>
{/block}

{block name="script"}
<script>
$(function(){
    //关闭分享
    function onBridgeReady() {
        WeixinJSBridge.call('hideOptionMenu');
    }
    if (typeof WeixinJSBridge == "undefined") {
        if (document.addEventListener) {
            document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false);
        } else if (document.attachEvent) {
            document.attachEvent('WeixinJSBridgeReady', onBridgeReady);
            document.attachEvent('onWeixinJSBridgeReady', onBridgeReady);
        }
    } else {
        onBridgeReady();
    }
    //css适配
    $(function(){
        $('#bk').height($(window).height());
    });
    //积分规则
    $('.rule').click(function(){
        $('#bk').fadeIn(300);
        $('#bk>div').fadeIn(300).css({'top':'50%'});
    });
	$('.phone').click(function(){
		window.location.href='http://mp.csppat.com/DDDeducation/public/index.php/home/user/call';
	});
    //积分窗口关闭
    $('#bk>div>a').click(function(){
        $('#bk').fadeOut(300);
        $('#bk>div').fadeOut(300).css({'top':'0%'});
//        $('body').css({'overflow-y':'scroll'});
    });
	//模块标题
	$('title' ).text('点对点教育VIP学员_个人中心');
	//头像大小
	var up = $('.up' );
	var path = up.attr('data-tab');
	var image = new Image();
	var ww = up.width();
	image.src = path ;
	up.css({"background-image":'url('+path+')'});
	image.onload = function(){
		if(image.width > image.height){
			up.css({"background-size":'auto '+ww +'px'});
		}else{
			up.css({"background-size":ww +'px'+' auto '});
		}
	};

})
</script>
{/block}